#ifndef _FSA_H_
#define _FSA_H_

//finite state automata

/*
	class : FSA (Finite State Automata)
	desc : This class represents a finite state automata
		for indicing through
*/
class FSA
{
	protected:
		//table used to determine next state
		unsigned char** table;
		//the current state that the table is in
		unsigned char currentState;
	public:
		//default constructor
		FSA();
		//constructor sets the table and currentstate to initial state
		FSA(unsigned char** table, unsigned char initialState);

		//this performs a transition making current state go to next
		//given an input. Indexing in the table is done like
		//the following :	state = table[input][state]
		void transition(unsigned char input);
		//returns what the next state would be if given input
		//does not set current state to next state
		unsigned char peek(unsigned char input);
		//gets the current state.
		unsigned char getState();
};



#endif 

